package javaweb.wudu.zengismall.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import javaweb.wudu.zengismall.data.ComputerMapper;
import javaweb.wudu.zengismall.dataBean.Computer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaginationSelectComputerService {

    @Autowired
    private ComputerMapper computerMapper;

    public Page<Computer> selectAll(int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        return (Page)computerMapper.selectAllComputer();
    }

    public Page<Computer> selectByPrice(float min,float max,int pageNumber, int pageSize){
        PageHelper.startPage(pageNumber,pageSize);
        return (Page)computerMapper.selectByPriceComputer(min,max);
    }
}
